{% extends "index/layout.html" %}
{% block title %}首页{% endblock %}
{% block head %}
    {{ super() }}
{% endblock %}
{% block content %}

    <!-- content srart -->
    <div class="am-g am-g-fixed blog-fixed">
        <div class="am-u-md-8 am-u-sm-12">
            {% for blog in data.blog %}
                <article class="am-g blog-entry-article">
                    <div class="am-u-lg-6 am-u-md-12 am-u-sm-12 blog-entry-img">
                        {% if blog.Blog.image %}
                            <img src="{{ url_for('static', filename=blog.Blog.image) }}" alt="" class="am-u-sm-12">
                        {% else %}
                            <img src="{{ url_for('static', filename='images/suoluetu.jpg') }}" alt="" class="am-u-sm-12">
                        {% endif %}
                    </div>
                    <div class="am-u-lg-6 am-u-md-12 am-u-sm-12 blog-entry-text">
                        <span> @<a href="http://weibo.com/jian19961230"
                                   class="blog-color">{{ blog.User.name }}&nbsp;</a></span>
                        <span>{{ blog.Blog.time }}</span>
                        <h1><a href="{{ url_for('.index_article',id = blog.Blog.id) }}">{{ blog.Blog.title }}</a></h1>
                        <p>{{ blog.Blog.article_intro }}
                        </p>
                    </div>
                </article>
            {% endfor %}
            <ul class="am-pagination">
                {% if pagination.has_prev %}
                    <li class="am-pagination-prev"><a href="{{ url_for('.index_index',page=pagination.page-1) }}">&laquo;
                        上一页</a></li>
                {% else %}
                    <li class="am-pagination-prev previous"><a href="">&laquo; 没有上一页</a></li>
                {% endif %}
                {% if pagination.has_next %}
                    <li class="am-pagination-next"><a href="{{ url_for('.index_index',page=pagination.page+1) }}">下一页
                        &raquo;</a></li>
                {% else %}
                    <li class="am-pagination-next"><a href="">没有下一页 &raquo;</a></li>
                {% endif %}

            </ul>
        </div>
        <div class="am-u-md-4 am-u-sm-12 blog-sidebar">
            {% block my %}
                {{ super() }}
            {% endblock %}
            <div class="blog-clear-margin blog-sidebar-widget blog-bor am-g ">
                <h2 class="blog-title"><span>友情链接</span></h2>
                <div class="am-u-sm-12 blog-clear-padding">
                    {% for yl in data.youlian %}
                        <a href="http://{{ yl.url }}" class="blog-tag">{{ yl.title }}</a>
                    {% endfor %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}
